package com.hhb.test;

import com.hhb.config.ConfigApp;
import com.hhb.service.CountService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.transaction.PlatformTransactionManager;

public class Demo01 {

    @Test
    public void test01(){

        ApplicationContext context = new ClassPathXmlApplicationContext("bean1.xml");


        CountService countServiceImpl = context.getBean("countServiceImpl", CountService.class);
        countServiceImpl.countMoney();
    }

    @Test
    public void test02(){

        ApplicationContext context = new AnnotationConfigApplicationContext(ConfigApp.class);


        CountService countServiceImpl = context.getBean("countServiceImpl", CountService.class);
        countServiceImpl.countMoney();
    }
}
